package ro.unibuc.hobbygroups.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;

import ro.unibuc.hobbygroups.dao.PicturesDAO;
import ro.unibuc.hobbygroups.domain.Picture;

public class PicturesServiceImpl implements PicturesService {

    private PicturesDAO picturesDao;

    public Picture findPicture(Long id) {
        return (Picture) picturesDao.find(id);
    }

    public List<Picture> findAll() {
        return picturesDao.findAll();
    }

    public void create(Picture picture, byte[] content) {
        picturesDao.create(picture, content);
    }

	public byte[] getPictureContent(Picture picture) {
		return picturesDao.getPictureContent(picture);
	}
	
	public byte[] getThumbContent(Picture picture) {
		return picturesDao.getThumbContent(picture);
	}
	
    @Required
    public void setPicturesDao(PicturesDAO picturesDao) {
        this.picturesDao = picturesDao;
    }
}